<template>
    <div>
        <el-table
        :data="tableData"
        style="width: 100%">
        <el-table-column
            
            prop="bookId"
            label="id"
            >
        </el-table-column>
        <el-table-column
            prop="bookName"
            label="书籍名称"
            >
        </el-table-column>
        <el-table-column
            prop="bookAuthor"
            label="作者"
            >
        </el-table-column>
        <el-table-column
            prop="score"
            label="评分"
            >
            <template slot-scope="scope">
                <el-rate
                    v-model="scope.row.score"
                    disabled
                    show-score
                    text-color="#ff9900"
                    score-template="{value}">
                </el-rate>
            </template>      
        </el-table-column>
        <el-table-column   
            label="操作"
            >
            <template slot-scope="scope">
            <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
            <el-button @click="handleEdit(scope.row)" type="text" size="small">编辑</el-button>
            </template>
        </el-table-column>
        </el-table>
    </div>
    
  </template>
  
  <script>

    export default {

        props:["tableData"],
        
        data() {
        
        },
        methods: {
            handleClick(row) {
                alert(JSON.stringify(row));
            // console.log("查看", row);
            
        // 这里可以根据需要编写查看的逻辑
            },
   
        },

      }
  
     
  </script>